/**
 * 自动生成！请勿修改！
 */
import { command } from '../core/command';

class VehicleVelocimeter {
    static categoryCode = '040040004';

    static categoryName = '车载测速仪';

    device = {};

    opts = {};

    _to = undefined;

    constructor(opt = {}) {
        const { device, to, ...opts } = opt;

        this.device = device;
        this.opts = opts;
        this._to = to;
    }

    get categoryCode() {
        return VehicleVelocimeter.categoryCode;
    }

    get categoryName() {
        return VehicleVelocimeter.categoryName;
    }

    getSpeed(params) {
        return command({
            method: 'getSpeed',
            methodId: 'pGegeeoS',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getSpeedingAlarm(params) {
        return command({
            method: 'getSpeedingAlarm',
            methodId: 'p1RY46iV',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getSwitch(params) {
        return command({
            method: 'getSwitch',
            methodId: 'pZwpBg9L',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    getThreshold(params) {
        return command({
            method: 'getThreshold',
            methodId: 'pUjL70mZ',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setSwitch(params) {
        return command({
            method: 'setSwitch',
            methodId: 'ppbbtWrd',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }

    setThreshold(params) {
        return command({
            method: 'setThreshold',
            methodId: 'pes4SR3r',
            params,
            to: this.to?.[this.i] || this.to,
        });
    }
}

export default VehicleVelocimeter;
